package com.ticket.sass.admin.dto.output.order;

import com.ticket.sass.common.entity.tenant.FilmScheduleEntity;
import com.ticket.sass.common.entity.tenant.enums.LaterPayRefundRecordStatus;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.Objects;

/**
 * @author ywb
 * @date 2024-05-07 18:30
 */
@Data
@ApiModel
public class RefundApplyRecordListOutput{
    
    @ApiModelProperty(value = "退款申请记录ID")
    private Long id;
    
    @ApiModelProperty(value = "申请类型")
    private Integer type;
    
    @ApiModelProperty(value = "申请内容")
    private String content;
    
    @ApiModelProperty(value = "订单ID")
    private Long orderId;
    
    @ApiModelProperty(value = "用户ID")
    private Long userId;
    
    @ApiModelProperty(value = "手机号")
    private String cellphone;
    
    @ApiModelProperty(value = "订单渠道 订单渠道：1 微信小程序，2 待定...")
    private Short channel;
    
    @ApiModelProperty(value = "状态 1 待审核 2 通过 3 驳回/不通过")
    private LaterPayRefundRecordStatus status;
    
    @ApiModelProperty(value = "验证码")
    private String verifyCode;
    
    @ApiModelProperty(value = "提示信息/驳回原因")
    private String message;
    
    @ApiModelProperty(value = "场次信息")
    private Schedule schedule;
    
    
    @Data
    @ApiModel
    public static class Schedule{
        @ApiModelProperty(value = "影厅")
        private String hall;
        
        @ApiModelProperty(value = "影片名")
        private String filmName;
        
        @ApiModelProperty(value = "放映时间")
        private LocalDateTime startTime;
        
        public Schedule() {
        }
        
        public Schedule(FilmScheduleEntity entity) {
            if (Objects.isNull(entity)){
                return;
            }
            
            this.hall = entity.getHall();
            this.filmName = entity.getFilmName();
            this.startTime = entity.getStartTime();
        }
    }
}
